/*
 * @Author       : xiaowu wwl093000@163.com
 * @Date         : 2023-06-21 10:49:25
 * @LastEditTime : 2023-07-31 16:06:34
 * @LastEditors  : xiaowu wwl093000@163.com
 * @FilePath     : /erp-admin-ui/src/api/persongather/collectProduct.js
 * @Description  : -
 */
import request from '@/utils/request'

// 查询采集商品
export function listCollectProduct(query) {
  return request({
    url: '/gather/seller/sellerCollectProduct/list',
    method: 'get',
    params: query
  })
}

// 查询采集商品详情
export function getCollectProduct(id) {
  return request({
    url: '/gather/seller/sellerCollectProduct/' + id,
    method: 'get'
  })
}

// 新增采集商品
export function addCollectProduct(data) {
  return request({
    url: '/gather/seller/sellerCollectProduct',
    method: 'post',
    data: data
  })
}

// 修改采集商品
export function updateCollectProduct(data) {
  return request({
    url: '/gather/seller/sellerCollectProduct',
    method: 'put',
    data: data
  })
}

// 暂存采集商品
export function stagingCollectProduct(data) {
  return request({
    url: '/gather/seller/sellerCollectProduct/staging',
    method: 'post',
    data: data
  })
}

// 删除采集商品
export function delCollectProduct(id) {
  return request({
    url: '/gather/seller/sellerCollectProduct/' + id,
    method: 'delete'
  })
}

// 新增规格名
export function addcollectProductSkuProperty(data) {
  return request({
    url: '/gather/gather/collectProductSkuProperty',
    method: 'post',
    data: data
  })
}

// 新增规格值
export function addCollectProductSkuProValue(data) {
  return request({
    url: '/gather/gather/collectProductSkuProValue',
    method: 'post',
    data: data
  })
}

// 商品刊登
export function collectProductPublish(query) {
  return request({
    url: '/gather/gather/collectProduct/publish',
    method: 'get',
    params: query
  })
}

// 运费试算
export function addFreightTask(query) {
  return request({
    url: '/freight/gather/collectProductFreightTask/addFreightTask',
    method: 'get',
    params: query
  })
}

// 重新运费试算
export function refreshFreightTask(query) {
  return request({
    url: '/freight/gather/collectProductFreightTask/refreshFreightTask',
    method: 'get',
    params: query
  })
}

// 翻译
export function addTranslateTask(query) {
  return request({
    url: '/gather/gather/collectProductTranslateTask/addTranslateTask',
    method: 'get',
    params: query
  })
}

// 重新翻译
export function refreshTranslateTask(query) {
  return request({
    url: '/gather/gather/collectProductTranslateTask/refreshTranslateTask',
    method: 'get',
    params: query
  })
}

// 忽略翻译
export function ignoreTranslateTask(id) {
  return request({
    url: '/gather/gather/collectProduct/ignoreTranslation?productId=' + id,
    method: 'get'
  })
}

// 忽略测试
export function ignoreUploadTest(id) {
  return request({
    url: '/gather/seller/sellerCollectProduct/ignoreTest?sellerCollectProId=' + id,
    method: 'get'
  })
}

// 商品属性
export function categoryInfo(id) {
  return request({
    url: '/gather/aliexpress/category/getCategoryInfoById?id=' + id,
    method: 'get'
  })
}

// 获取详情的关键词
export function extractDescription(query) {
  return request({
    url: '/gather/gather/chatgpt/extractDescription',
    method: 'get',
    params: query
  })
}

// 获取标题的关键词
export function extractKeyWords(query) {
  return request({
    url: '/gather/gather/chatgpt/extractKeyWords',
    method: 'get',
    params: query
  })
}

// 详情页翻译
export function translate(query) {
  return request({
    url: '/gather/gather/chatgpt/translate',
    method: 'get',
    params: query
  })
}

// 根据标题关键词生成标题
export function createTitle(query) {
  return request({
    url: '/gather/gather/chatgpt/createTitle',
    method: 'get',
    params: query
  })
}

// 根据详情关键词生成详情
export function createProductDescription(query) {
  return request({
    url: '/gather/gather/chatgpt/createProductDescription',
    method: 'get',
    params: query
  })
}

// 修复下架商品
export function repairProductTakedown(query) {
  return request({
    url: '/gather/gather/productUnifiedTakedown/repairProductTakedown',
    method: 'get',
    params: query
  })
}

// f复制
export function copyProd(query) {
  return request({
    url: '/gather/gather/collectProduct/copyProd',
    method: 'get',
    params: query
  })
}

// 公共采集库导入
export function addToSellerPro(query) {
  return request({
    url: '/gather/gather/collectProduct/addToSellerPro',
    method: 'get',
    params: query
  })
}

// 发布个人产品库
export function joinPublish(query) {
  return request({
    url: '/gather/seller/sellerCollectProduct/publish',
    method: 'get',
    params: query
  })
}

// 批量测试发布
export function productUploadTestBatch(query) {
  return request({
    url: '/gather/gather/collectProduct/productUploadTestBatch',
    method: 'get',
    params: query
  })
}

// 取消测试发布
export function cancelUploadTest(query) {
  return request({
    url: '/gather/gather/collectProduct/cancelUploadTest',
    method: 'get',
    params: query
  })
}

// 规格合并
export function updateCateGoryProById(query) {
  return request({
    url: '/gather/seller/sellerCollectProduct/updateCateGoryProById',
    method: 'get',
    params: query
  })
}

// 同步个人商品库
export function synchronizationProductEdit(query) {
  return request({
    url: '/gather/AEProduct/synchronizationProductEdit',
    method: 'get',
    params: query
  })
}


// 同步个人商品库
export function queryProgram(query) {
  return request({
    url: '/gather/gather/collectProductQualificationProgram/queryProgramByCollectProductId',
    method: 'get',
    params: query
  })
}

// 删除采集商品
export function publishBatch(id) {
  return request({
    url: '/gather/seller/sellerCollectProduct/publishBatch/' + id,
    method: 'get'
  })
}
